package com.hz.house.enums;

/**
 * <p> 面积查询条件枚举
 * @param id
 * @param name
 * @param minSpace
 * @param maxSpace
 */
public enum SearchSpaceConditionEnum {
	 
	LESS_70(1,"70㎡以下",0,70),
	LESS_90(2,"70-90㎡",70,90),
	LESS_120(3,"90-120㎡",90,120),
	LESS_150(4,"120-150㎡",120,150),
	LESS_180(5,"150-180㎡",150,180),
	MORE_180(6,"180㎡以上",180,18000);
	
	
	private int id;
	
	private String name;
	
	private float minSpace;
	
	private float maxSpace;
	
	SearchSpaceConditionEnum(int id,String name,float minSpace,float maxSpace){
		this.id=id;
		this.name=name;
		this.minSpace=minSpace;
		this.maxSpace=maxSpace;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public float getMinSpace() {
		return minSpace;
	}

	public float getMaxSpace() {
		return maxSpace;
	}
	
	/**
	 * <p> 根据id获取查询条件
	 * @param id
	 * @return
	 */
	public static  SearchSpaceConditionEnum getSpaceConditionByid(int id) {
		SearchSpaceConditionEnum[] all = SearchSpaceConditionEnum.values();
		for(SearchSpaceConditionEnum s:all) {
			if(s.getId()==id)
				return s;
		}
		return null;
	}
	
}
